home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / AppleScript.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  5.7 KB  |  211 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        AppleScript.h
  3.  
  4.      Contains:    AppleScript Specific Interfaces.
  5.  
  6.      Version:    Technology:    AppleScript 1.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1992-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __APPLESCRIPT__
  19. #define __APPLESCRIPT__
  20.  
  21. #ifndef __ERRORS__
  22. #include <Errors.h>
  23. #endif
  24. #ifndef __APPLEEVENTS__
  25. #include <AppleEvents.h>
  26. #endif
  27. #ifndef __OSA__
  28. #include <OSA.h>
  29. #endif
  30. #ifndef __TEXTEDIT__
  31. #include <TextEdit.h>
  32. #endif
  33.  
  34.  
  35.  
  36. #if PRAGMA_ONCE
  37. #pragma once
  38. #endif
  39.  
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43.  
  44. #if PRAGMA_IMPORT
  45. #pragma import on
  46. #endif
  47.  
  48. #if PRAGMA_STRUCT_ALIGN
  49.     #pragma options align=mac68k
  50. #elif PRAGMA_STRUCT_PACKPUSH
  51.     #pragma pack(push, 2)
  52. #elif PRAGMA_STRUCT_PACK
  53.     #pragma pack(2)
  54. #endif
  55.  
  56. /**************************************************************************
  57.     Types and Constants
  58. **************************************************************************/
  59. /*
  60.     The specific type for the AppleScript instance of the
  61.     Open Scripting Architecture type.
  62. */
  63.  
  64. enum {
  65.     typeAppleScript                = FOUR_CHAR_CODE('ascr'),
  66.     kAppleScriptSubtype            = typeAppleScript,
  67.     typeASStorage                = typeAppleScript
  68. };
  69.  
  70. /**************************************************************************
  71.     Component Selectors
  72. **************************************************************************/
  73.  
  74.  
  75. enum {
  76.     kASSelectInit                = 0x1001,
  77.     kASSelectSetSourceStyles    = 0x1002,
  78.     kASSelectGetSourceStyles    = 0x1003,
  79.     kASSelectGetSourceStyleNames = 0x1004
  80. };
  81.  
  82.  
  83. /**************************************************************************
  84.     OSAGetScriptInfo Selectors
  85. **************************************************************************/
  86.  
  87. enum {
  88.     kASHasOpenHandler            = FOUR_CHAR_CODE('hsod')
  89. };
  90.  
  91. /*
  92.         This selector is used to query a context as to whether it contains
  93.         a handler for the kAEOpenDocuments event. This allows "applets" to be 
  94.         distinguished from "droplets."  OSAGetScriptInfo returns false if
  95.         there is no kAEOpenDocuments handler, and returns the error value 
  96.         errOSAInvalidAccess if the input is not a context.
  97.     */
  98. /**************************************************************************
  99.     Initialization
  100. **************************************************************************/
  101. EXTERN_API( OSAError )
  102. ASInit                            (ComponentInstance         scriptingComponent,
  103.                                  long                     modeFlags,
  104.                                  long                     minStackSize,
  105.                                  long                     preferredStackSize,
  106.                                  long                     maxStackSize,
  107.                                  long                     minHeapSize,
  108.                                  long                     preferredHeapSize,
  109.                                  long                     maxHeapSize)                        FIVEWORDINLINE(0x2F3C, 0x001C, 0x1001, 0x7000, 0xA82A);
  110.  
  111. /*
  112.         ComponentCallNow(kASSelectInit, 28);
  113.         This call can be used to explicitly initialize AppleScript.  If it is
  114.         not called, the a scripting size resource is looked for and used. If
  115.         there is no scripting size resource, then the constants listed below
  116.         are used.  If at any stage (the init call, the size resource, the 
  117.         defaults) any of these parameters are zero, then parameters from the
  118.         next stage are used.  ModeFlags are not currently used.
  119.         Errors:
  120.         errOSASystemError        initialization failed
  121.     */
  122. /*
  123.     These values will be used if ASInit is not called explicitly, or if any
  124.     of ASInit's parameters are zero:
  125. */
  126.  
  127. enum {
  128.     kASDefaultMinStackSize        = 4 * 1024,
  129.     kASDefaultPreferredStackSize = 16 * 1024,
  130.     kASDefaultMaxStackSize        = 16 * 1024,
  131.     kASDefaultMinHeapSize        = 4 * 1024,
  132.     kASDefaultPreferredHeapSize    = 16 * 1024,
  133.     kASDefaultMaxHeapSize        = 32L * 1024 * 1024
  134. };
  135.  
  136. /**************************************************************************
  137.     Source Styles
  138. **************************************************************************/
  139. EXTERN_API( OSAError )
  140. ASSetSourceStyles                (ComponentInstance         scriptingComponent,
  141.                                  STHandle                 sourceStyles)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x1002, 0x7000, 0xA82A);
  142.  
  143. /*
  144.         ComponentCallNow(kASSelectSetSourceStyles, 4);
  145.         Errors:
  146.         errOSASystemError        operation failed
  147.     */
  148. EXTERN_API( OSAError )
  149. ASGetSourceStyles                (ComponentInstance         scriptingComponent,
  150.                                  STHandle *                resultingSourceStyles)                FIVEWORDINLINE(0x2F3C, 0x0004, 0x1003, 0x7000, 0xA82A);
  151.  
  152. /*
  153.         ComponentCallNow(kASSelectGetSourceStyles, 4);
  154.         Errors:
  155.         errOSASystemError        operation failed
  156.     */
  157. EXTERN_API( OSAError )
  158. ASGetSourceStyleNames            (ComponentInstance         scriptingComponent,
  159.                                  long                     modeFlags,
  160.                                  AEDescList *            resultingSourceStyleNamesList)        FIVEWORDINLINE(0x2F3C, 0x0008, 0x1004, 0x7000, 0xA82A);
  161.  
  162. /*
  163.         ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  164.         This call returns an AEList of styled text descriptors the names of the
  165.         source styles in the current dialect.  The order of the names corresponds
  166.         to the order of the source style constants, below.  The style of each
  167.         name is the same as the styles returned by ASGetSourceStyles.
  168.         
  169.         Errors:
  170.         errOSASystemError        operation failed
  171.     */
  172. /*
  173.     Elements of STHandle correspond to following categories of tokens, and
  174.     accessed through following index constants:
  175. */
  176.  
  177. enum {
  178.     kASSourceStyleUncompiledText = 0,
  179.     kASSourceStyleNormalText    = 1,
  180.     kASSourceStyleLanguageKeyword = 2,
  181.     kASSourceStyleApplicationKeyword = 3,
  182.     kASSourceStyleComment        = 4,
  183.     kASSourceStyleLiteral        = 5,
  184.     kASSourceStyleUserSymbol    = 6,
  185.     kASSourceStyleObjectSpecifier = 7,
  186.     kASNumberOfSourceStyles        = 8
  187. };
  188.  
  189.  
  190.  
  191. #if PRAGMA_STRUCT_ALIGN
  192.     #pragma options align=reset
  193. #elif PRAGMA_STRUCT_PACKPUSH
  194.     #pragma pack(pop)
  195. #elif PRAGMA_STRUCT_PACK
  196.     #pragma pack()
  197. #endif
  198.  
  199. #ifdef PRAGMA_IMPORT_OFF
  200. #pragma import off
  201. #elif PRAGMA_IMPORT
  202. #pragma import reset
  203. #endif
  204.  
  205. #ifdef __cplusplus
  206. }
  207. #endif
  208.  
  209. #endif /* __APPLESCRIPT__ */
  210.  
  211.